{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<link rel="stylesheet" type="text/css" href="__SYSMET__/h-ui.admin/css/kaiguan.css" />
<style>
.tabBar a {
	background-color: #e8e8e8;
	cursor: pointer;
	display: inline-block;
	float: left;
	font-weight: bold;
	height: 30px;
	line-height: 30px;
	padding: 0 15px
}

.tabBar a.current {
	background-color: #636363;
	color: #fff;
}
.tabBar a:hover{
	color: #333;
}
.bg-1 {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}
.radius:hover{
 	color: #333;
	background-color: #e5e5e5;
    border-color: #e5e5e5;
 }
.radius1:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 span:hover{
 	color: #333;
 }
 .btn-primary1 {
    color: #fff;
    background-color: #5a98de;
    border-color: #5a98de;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
}
.label-success[href], .badge-success[href] {
    background-color: #636363;
    color: #fff;
}



</style>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i>
		系统管理
		<span class="c-gray en">&gt;</span>
		运营管理
		<span class="c-gray en">&gt;</span>
		未结算邮箱提醒
		<a class="btn btn-success radius r"
			style="line-height: 1.6em; margin-top: 3px"
			href="javascript:location.replace(location.href);" title="刷新">
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
	
	<div style="padding:20px;height:30px;">
  	
  	<div class="new_box" style="margin-bottom: 20px;">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a class="btn btn-primary radius" data-title="添加客服" href="{:url('admin/Systemsettings/email_add')}"><i class="Hui-iconfont">&#xe600;</i> 添加客服</a></span></div>
	<div class="page-container">
		<div id="tab-system" class="HuiTab">
			
			<div class="tabCon">
				<div class="mt-20">
					
					<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
						<thead>
							<tr class="text-c">
								<th>ID</th>
								<th>客服名称</th>
								
								<th>邮件地址</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{volist name="list" id="vo"}
							<tr class="text-c">
								<td>{$vo.id}</td>
								<td class="text-l">{$vo.name}</td>
								<td>{$vo.qq}</td>
								<td class="td-status">
									{if condition="$vo['status']==1"}
									<a class="label label-success radius"
										href="/admin/systemsettings/serviceStatus?id={$vo.id}&status=0&kftype=5">正常</a>
									{else/}
									<a class="label label-danger radius"
										href="/admin/systemsettings/serviceStatus?id={$vo.id}&status=1&kftype=5">禁用</a>
									{/if}
								</td>
								<td class="f-14 td-manage">
									<a style="text-decoration: none" class="ml-5"
										href="javascript:;"
										onclick="if(confirm('是否确认操作？')) {window.location.href='/admin/systemsettings/emailserviceDel?id={$vo.id}'}">
										<i class="Hui-iconfont">&#xe6e2;</i>
									</a>
								</td>
							</tr>
							
							{/volist}

						</tbody>
					</table>
					
				</div>
			</div>
		</div>
	</div>

	
	
	</div>
	</div>

	{/block} {block name="js"}
	<script type="text/javascript">
	
		$(function() {
			$('.skin-minimal input').iCheck({
				checkboxClass : 'icheckbox-blue',
				radioClass : 'iradio-blue',
				increaseArea : '20%'
			});
			$("#tab-system").Huitab({
				index : 0
			});
		});
		$("#tijiao").click(function(){
			var name=$('#name').val();
			var qq=$('#qq').val();
			var radio = document.getElementsByName('type');
			var han = /^[\u4e00-\u9fa5]+$/;
			var bValidate = RegExp(/^[1-9][0-9]{4,12}$/).test(qq);
			if(name==''){
				$("#a1").css('display','block').html('客服名称不能为空');
				return false;
			}else if(qq==''){
				$("#b1").css('display','block').html('客服QQ不能为空');
				return false;
			}else{
				if(han.test(name)){
					$("#a1").css('display','none');
						$("#b1").css('display','none');
						$.ajax({
							type:'POST',
					          url:"{:url('Systemsettings/add_kefu')}",
					          data:{
					            'name':name,'qq':qq,'type':4
					          },
					          success:function(data){
					        	  console.log(data);
					        	  return false;
					        	  /* if(data=='1'){
					        		  alert('添加成功');
					        	  }else if(data=='0'){
					        		  alert('添加失败');
					        	  }else if(data=="2"){
					        		  alert('客服名称不能为空');
					        	  }else if(data=="3"){
					        		  alert('QQ号码不能为空');
					        	  } */
					          },
					          error:function(msg){
					        	  console.log(msg);
					        	  return false;
					          }
						});
				}else{
					$("#a1").css('display','block').html('客服名称必须为汉字');
					return false;
				}
			}
		});
	</script>
	{/block}